Rect Class
Description:
A class for creating rectangle objects.
zero
Type: Readonly Field.
Description:
A rectangle object with all properties set to 0.
Signature:
const zero: Rect
__call
Type: Metamethod.
Description:
Create a new rectangle object using another rectangle object.
Signature:
metamethod __call: function(self: RectClass, other: Rect): Rect
Parameters:
Parameter | Type | Description |
---|---|---|
other | Rect | The other rectangle object to create a new rectangle object from. |
Returns:
Return Type | Description |
---|---|
Rect | A new rectangle object. |
__call
Type: Metamethod.
Description:
Create a new rectangle object using individual properties.
Signature:
metamethod __call: function(self: RectClass,
x: number,
y: number,
width: number,
height: number): Rect
Parameters:
Parameter | Type | Description |
---|---|---|
x | number | The x-coordinate of the origin of the rectangle. |
y | number | The y-coordinate of the origin of the rectangle. |
width | number | The width of the rectangle. |
height | number | The height of the rectangle. |
Returns:
Return Type | Description |
---|---|
Rect | A new rectangle object. |
__call
Type: Metamethod.
Description:
Create a new rectangle object using a Vec2 object for the origin and a Size object for the size.
Signature:
metamethod __call: function(self: RectClass, origin: Vec2, size: Size): Rect
Parameters:
Parameter | Type | Description |
---|---|---|
origin | Vec2 | The origin of the rectangle, represented by a Vec2 object. |
size | Size | The size of the rectangle, represented by a Size object. |
Returns:
Return Type | Description |
---|---|
Rect | A new rectangle object. |
__call
Type: Metamethod.
Description:
Create a new rectangle object with all properties set to 0.
Signature:
metamethod __call: function(self: RectClass): Rect
Returns:
Return Type | Description |
---|---|
Rect | A new rectangle object. |